#include "Role.h"


Role::Role(void)
	:_examplesType(e_ser)
{
	_mapSize = Size(0,0);
}


Role::~Role(void)
{
	if (_sprite)
	{
		delete _sprite;
		_sprite = nullptr;
	}
}

void Role::init()
{
}

void Role::updata( float times )
{

}

void Role::setMapSize( Size size )
{
	_mapSize = size;
	UpdataSpritePos();
}

void Role::setPos( Point pt )
{
	_x = pt.x;
	_y = pt.y;
	UpdataSpritePos();
}

void Role::UpdataSpritePos()
{
	Point pos( _x, 0 );
	pos.y = _mapSize.height - _y;
	_sprite->setPosition( pos );
}

void Role::setModelName( string modelName )
{

}
